*//////////////////////////////////////////////////////////////////////////////
*                                                                             /         
*				High-Pressure, High-Paying Jobs?                              /
*               The Review of Economics and Statistics                        /
*                                                                             /
*               Authors: Markus Nagler, Johannes Rincke, Erwin Winkler        /
*                                                                             /
*               Do-File 4: Time Trend across all waves                        /
*                                                                             /
*               This file generates:                                          /
*               - Figures A6,A7,A9                                            /
*               - Table A1                                                    /
*                                                                             /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////





********************************************************************************
****************************** BIBB 2018 ***************************************
********************************************************************************

use "$orig\ZA7574_v1-0-0.dta", replace
gen year=2018


gen d_deadlines =(F411_01==1)
	replace d_deadlines=. if F411_01==9

gen d_multitasking=(F411_09==1)
	replace d_multitasking=. if inlist(F411_09,9)

gen d_interrupt=(F411_06==1)
	replace d_interrupt=. if F411_06==9	

gen d_minimum=(F411_07==1)
	replace d_minimum=. if F411_07==9	
	
gen d_fast=(F411_13==1)
	replace d_fast=. if F411_13==9
	
	
	
	
gen high_edu=0
	replace high_edu=1 if max1202==4 

gen med_edu=0
	replace med_edu=1 if inlist(max1202,2,3) 

gen low_edu=0
	replace low_edu=1 if high_edu==0 & med_edu==0 

gen age=zpalter

gen female=(S1==2)

gen german=(F1607_01==1)

gen weight= gew2018 

gen works_council=(F515_01==1)
	replace works_council=. if F515_01==9
	
gen temp_contract=(F507==1) 
	replace temp_contract=. if F507==9
	
gen computer=(F318==1)

gen d_routine=(F411_03==1)
	replace d_routine=. if F411_03==9
	
gen normal_workhours=(F209==1) 
	replace normal_workhours=. if F209==9
	
gen shift=(F209_01==1) 
	replace shift=. if F209_01==9
	
gen standby=(F216_01==1 )
gen occ = F100_kldb2010_3d 
gen position = Stib
gen hours=az
gen income=F518_SUF
gen ind=Sector08
gen nuts2_work=F233_nuts2

gen BIK=BIK10
gen temp_agency=(F509==1)
	replace temp_agency=. if F509==9 
	
gen  firmsize=F515
	replace firmsize=. if firmsize==99

gen firmsize1=0
	replace firmsize1=1 if inlist(firmsize,1,2,3)
	replace firmsize1=. if firmsize==.

gen firmsize2=0
	replace firmsize2=1 if inlist(firmsize,4,5,6) 
	replace firmsize2=. if firmsize==.
	
gen firmsize3=0
	replace firmsize3=1 if inlist(firmsize,7) 
	replace firmsize3=. if firmsize==.

gen firmsize4=0
	replace firmsize4=1 if inlist(firmsize,8,9) 
	replace firmsize4=. if firmsize==.

gen firmsize5=0
replace firmsize4=1 if inlist(firmsize,10,11) 
	replace firmsize5=. if firmsize==.
	
gen d_codifiable=(F411_02==1)
	replace d_codifiable=. if F411_02==9

gen phys1=0
	replace phys1=1 if inlist(F600_03,1,2,3) 
	replace phys1=. if F600_03==9
	drop F600_03
	
gen phys2=0
	replace phys2=1 if inlist(F600_04,1,2,3) 
	replace phys2=. if F600_04==9
	drop F600_04
	
gen phys3=0
	replace phys3=1 if inlist(F600_05,1,2,3) 
	replace phys3=. if F600_05==9
	drop F600_05

gen phys4=0
	replace phys4=1 if inlist(F600_06,1,2,3) 
	replace phys4=. if F600_06==9
	drop F600_06
	
gen phys5=0
	replace phys5=1 if inlist(F600_07b,1,2,3)==1 
	replace phys5=. if F600_07b==9	
	drop F600_07b
	
gen phys6=0
	replace phys6=1 if inlist(F600_09,1,2,3)==1 
	replace phys6=. if F600_09==9
	drop F600_09
	
gen phys7=0
	replace phys7=1 if inlist(F600_12,1,2,3)==1
	replace phys7=. if F600_12==9	
	drop F600_12
	
gen phys8=0
	replace phys8=1 if inlist(F600_12a,1,2,3)==1 
	replace phys8=. if F600_12a==9
	drop F600_12a
	
gen commute=0
	replace commute=1 if nuts2!=nuts2_work
	
gen east=0
	replace east=1 if inlist(Bula,11,12,13,14,15,16)
	


keep year d_deadlines d_multitasking d_interrupt d_minimum d_fast high_edu med_edu low_edu ///
 age  female german  works_council commute  temp_contract normal_workhours shift ///
 standby computer d_routine occ position hours income ind nuts2_work nuts2 BIK ///
 temp_agency firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys4 phys5 phys6 phys7 phys8  weight east
 

keep if age>=20 & age<=60 
keep if inlist(position, 1,2,9)
keep if hours>=35

  

save "$data\bibb_2018_short.dta", replace





********************************************************************************
****************************** BIBB 2012 ***************************************
********************************************************************************

use "$orig\ZA5657_v6-0-0.dta", replace
gen year=2012


gen d_deadlines=(F411_01==1)
	replace d_deadlines=. if F411_01==9
	
gen d_multitasking =(F411_09==1)
	replace d_multitasking =. if F411_09==9
	
gen d_interrupt =(F411_06==1)
	replace d_interrupt=. if F411_06==9
	
gen d_minimum =(F411_07==1)
	replace d_minimum=. if F411_07==9
	
gen d_fast=(F411_13==1)
	replace d_fast=. if F411_13==9
	

	
gen high_edu=(Max1202==4)

gen med_edu=(Max1202==2|Max1202==3)

gen low_edu=(med_edu==0 & high_edu==0)

gen age = Zpalter

gen female= (S1==2)

gen german=(F1607_01==1)

gen weight=Gew2012

gen temp_contract=(F507==1)
	replace temp_contract=. if F507==9
	
gen computer=(F318==1)
	replace computer=. if F318==9
	
gen d_routine=(F411_03==1)
	replace d_routine=. if F411_03==9
	
gen normal_workhours=(F209==1)
	replace normal_workhours=. if F209==9
	
gen shift= (F209_01==1)
	replace shift=. if F209_01==9
	
gen standby =(F216==1)
	replace standby=. if F216==9
	
gen occ =F100_kldb2010_3d

gen position=  Stib

gen hours =az

gen income =F518_SUF
	replace income=. if (income==99998|income==99999)
	
gen ind=Sector08

gen BIK=Bik10

gen temp_agency=(F509==1)
	replace temp_agency=. if F509==9
	
gen  firmsize=F515
	replace firmsize=. if F515==9
gen firmsize1=0
	replace firmsize1=1 if inlist(firmsize,1,2,3) 
	replace firmsize1=. if firmsize==.
gen firmsize2=0
	replace firmsize2=1 if inlist(firmsize,4,5,6) 
	replace firmsize2=. if firmsize==.
gen firmsize3=0
	replace firmsize3=1 if inlist(firmsize,7)
	replace firmsize3=. if firmsize==.
gen firmsize4=0
	replace firmsize4=1 if inlist(firmsize,8,9) 
	replace firmsize4=. if firmsize==.
gen firmsize5=0
	replace firmsize5=1 if inlist(firmsize,10,11) 
	replace firmsize5=. if firmsize==.
	
gen d_codifiable=( F411_02==1)
	replace d_codifiable=. if F411_02==9
	
gen phys1=0
	replace phys1=1 if inlist(F600_03,1,2,3) 
	replace phys1=. if F600_03 ==9 
gen phys2=(F600_04 ==1| F600_04 ==2|F600_04 ==3)
	replace phys2=. if F600_04 ==9 
gen phys3=(F600_05 ==1| F600_05 ==2|F600_05 ==3)
	replace phys3=. if F600_05 ==9 
gen phys4=(F600_06 ==1| F600_06 ==2|F600_06 ==3)
	replace phys4=. if F600_06 ==9  
gen phys5=(F600_07b ==1| F600_07b ==2|F600_07b ==3)
	replace phys5=. if F600_07b ==9 
gen phys6=(F600_09 ==1| F600_09 ==2|F600_09 ==3)
	replace phys6=. if F600_09 ==9  
gen phys7=(F600_12 ==1| F600_12 ==2|F600_12 ==3)
	replace phys7=. if F600_12 ==9 

gen nuts2=Nuts2

gen east=0
	replace east=1 if inlist(Bula,11,12,13,14,15,16)


keep year d_deadlines d_multitasking d_interrupt d_minimum d_fast high_edu med_edu low_edu ///
 age  female german   temp_contract normal_workhours shift ///
 standby computer d_routine occ position hours income ind nuts2 BIK ///
 temp_agency firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys4 phys5 phys6 phys7  weight east



keep if age>=20 & age<=60 
keep if inlist(position, 1,2,9)
keep if hours>=35

 
save "$data\bibb_2012_short.dta", replace





********************************************************************************
****************************** BIBB 2006 ***************************************
********************************************************************************

use "$orig\ZA4820_v2-0-0.dta", replace
gen year=2006


gen d_deadlines=( f411_01 ==1)
	replace d_deadlines=. if f411_01 ==9
	
gen d_multitasking =(f411_09==1)
	replace d_multitasking =. if f411_09==9
	
gen d_interrupt=( f411_06==1)
	replace d_interrupt=. if f411_06==9
	
gen d_minimum =(f411_07==1)
	replace d_minimum =. if f411_07==9
	
gen d_fast =(f411_13==1)
	replace d_fast=. if f411_13==9

	
gen high_edu=(max1202==4)

gen med_edu=(max1202==2|max1202==3)

gen low_edu=(high_edu==0 & med_edu==0)

gen age=zpalter

gen female=(s1==2)

gen german=f1607_01

gen weight=gew3_05 

gen temp_contract=(f507==1)
	replace temp_contract=. if f507==9
	
gen computer=( f318==1)
	replace computer=. if f318==9
	
gen d_routine=(f411_03==1)
	replace d_routine=. if  f411_03==9
	

gen shift =(f210==1)
	replace shift =. if f210==9
	
gen standby =(f216==1)
	replace standby =. if f216==9
	
gen occ  = f100_kldb2010_3d

gen position = stib

gen hours=az

gen income = f518
	replace income=. if (f518==99998|f518==99999)
	
gen ind = sector

gen BIK=bik

gen temp_agency=(f509==1)
	replace temp_agency=. if f509==9
	
gen  firmsize= f515
		replace firmsize=. if f515==99

gen firmsize1=0
	replace firmsize1=1 if inlist(firmsize,1,2,3) 
	replace firmsize1=. if firmsize==.

gen firmsize2=0
	replace firmsize2=1 if inlist(firmsize,4,5,6) 
	replace firmsize2=. if firmsize==.
	
gen firmsize3=0
	replace firmsize3=1 if inlist(firmsize,7)
	replace firmsize3=. if firmsize==.

gen firmsize4=0
	replace firmsize4=1 if inlist(firmsize,8,9) 
	replace firmsize4=. if firmsize==.

gen firmsize5=0
	replace firmsize5=1 if inlist(firmsize,10,11) 
	replace firmsize5=. if firmsize==.
	
gen d_codifiable= (f411_02==1)
	replace d_codifiable=. if f411_02==9
	
gen phys1=0
	replace phys1=1 if inlist(f600_03,1,2,3) 
	replace phys1=. if f600_03==9
	
gen phys2=0
	replace phys2=1 if inlist(f600_04,1,2,3) 
	replace phys2=. if f600_04==9
	
gen phys3=0
	replace phys3=1 if inlist(f600_05,1,2,3) 
	replace phys3=. if f600_05==9

gen phys4=0
	replace phys4=1 if inlist(f600_06,1,2,3) 
	replace phys4=. if f600_06==9
	
	
gen phys6=0
	replace phys6=1 if inlist(f600_09,1,2,3)==1 
	replace phys6=. if f600_09==9
	
gen phys7=0
	replace phys7=1 if inlist(f600_12,1,2,3)==1
	replace phys7=. if f600_12==9	
	
gen east=0
	replace east=1 if inlist(bula,11,12,13,14,15,16)
	

keep year d_deadlines d_multitasking d_interrupt d_minimum d_fast high_edu med_edu low_edu ///
 age  female german   temp_contract shift ///
 standby computer d_routine occ position hours income ind nuts2 BIK ///
 temp_agency firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys4 phys6 phys7  weight east
 


keep if age>=20 & age<=60 
keep if inlist(position, 1,2,9)
keep if hours>=35

save "$data\bibb_2006_short.dta", replace






********************************************************************************
****************************** BIBB 1999 ***************************************
********************************************************************************

use "$orig\ZA3379_v1-1-0.dta", replace
gen year=1999

gen d_deadlines=0
	replace d_deadlines=1 if inlist(v264,1,2)
	replace d_deadlines=. if (inlist(v264,1,2,3,4,5)==0) 
	
gen d_multitasking=0
	replace d_multitasking=1 if inlist(v272,1,2)
	replace d_multitasking=. if (inlist(v272,1,2,3,4,5)==0)
	
gen d_interrupt=0
	replace d_interrupt=1 if inlist(v269,1,2)
	replace d_interrupt=. if (inlist(v269,1,2,3,4,5)==0)

gen d_minimum=0
	replace d_minimum=1 if inlist(v270,1,2)
	replace d_minimum=. if (inlist(v270,1,2,3,4,5)==0)


	
gen high_edu=(v788==5|v788==6) 

gen med_edu=(v788==2|v788==3|v788==4) & high_edu==0

gen low_edu=(med_edu==0&high_edu==0)

gen age=v8

gen female=(v5==2)

gen german=(v780==1)

gen weight=v789

gen temp_contract=(v126==1)
	replace temp_contract=. if  v126!=1 & v126!=2
	
gen computer= v787

gen d_routine=0
	replace d_routine=1 if inlist(v266,1,2)
	replace d_routine=. if (inlist(v266,1,2,3,4,5)==0)
	
gen shift=(v142==1)
	replace shift=. if v142!=1 & v142!=2
	
ren v10 kldb88_3

joinby kldb88_3 using "$orig\kldb88_3_10_5.dta", unmatched(master)

gen occ = kldb10_3 

gen position = v117 

gen hours = v29
	replace hours=. if v29==9999
	
gen income = v147	

gen ind=v134 

gen BIK=v784

gen temp_agency=(v128==1)
	replace temp_agency=. if v128!=1 & v128!=2
	
gen  firmsize= v140
		replace firmsize=. if (inlist(v140,1,2,3,4,5,6,7,8,9,10)==0)

gen firmsize1=0
	replace firmsize1=1 if inlist(firmsize,1,2,3)
	replace firmsize1=. if firmsize==.

gen firmsize2=0
	replace firmsize2=1 if inlist(firmsize,4,5) 
	replace firmsize2=. if firmsize==.
	
gen firmsize3=0
	replace firmsize3=1 if inlist(firmsize,6) 
	replace firmsize3=. if firmsize==.

gen firmsize4=0
	replace firmsize4=1 if inlist(firmsize,7) 
	replace firmsize4=. if firmsize==.

gen firmsize5=0
	replace firmsize4=1 if inlist(firmsize,8,9)
	replace firmsize4=. if firmsize==.
	
gen d_codifiable=0
	replace d_codifiable=1 if inlist(v265,1,2)
	replace d_codifiable=. if (inlist(v265,1,2,3,4,5)==0)
	
gen phys1=0
	replace phys1=1 if inlist(v252,1,2,3) 
	replace phys1=. if (inlist(v252,1,2,3,4,5)==0 )

gen phys2=0
	replace phys2=1 if inlist(v253,1,2,3) 
	replace phys2=. if (inlist(v253,1,2,3,4,5)==0 )

gen phys3=0
	replace phys3=1 if inlist(v254,1,2,3) 
	replace phys3=. if (inlist(v254,1,2,3,4,5)==0 )

gen phys4=0
	replace phys4=1 if inlist(v255,1,2,3) 
	replace phys4=. if (inlist(v255,1,2,3,4,5)==0 )
	
	
gen phys6=0
	replace phys6=1 if inlist(v258,1,2,3)==1 
	replace phys6=. if (inlist(v258,1,2,3,4,5)==0 )
	
gen phys7=0
	replace phys7=1 if inlist(v261,1,2,3)==1 
	replace phys7=. if (inlist(v261,1,2,3,4,5)==0 )
	
gen east=0
	replace east=1 if inlist(v782,11,12,13,14,15,16)

keep year d_deadlines d_multitasking d_interrupt d_minimum high_edu med_edu low_edu ///
 age  female german  temp_contract shift ///
  computer d_routine occ position hours income ind BIK ///
 temp_agency firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys4 phys6 phys7  weight east

 
keep if age>=20 & age<=60 
keep if position<3 
keep if hours>=35

save "$data\bibb_1999_short.dta", replace







********************************************************************************
****************************** BIBB 1992 ***************************************
********************************************************************************

use "$orig\ZA2565.dta", replace
gen year=1992


gen d_deadlines=0
	replace d_deadlines=1 if inlist(v183,1,2)
	replace d_deadlines=. if (inlist(v183,1,2,3,4,5)==0)
	
gen high_edu=0
	replace high_edu=1 if v233==1
	replace high_edu=1 if v232==1

gen med_edu=0
	replace med_edu=1 if v205==1 & high_edu==0
	replace med_edu=1 if v231==1 & high_edu==0
	replace med_edu=1 if v230==1 & high_edu==0
	replace med_edu=1 if v228==1 & high_edu==0
	
gen low_edu=(high_edu==0 & med_edu==0)

gen age= v299 

gen female= (v292==2)

gen german =(v301==1)

gen weight= v318


gen temp_contract =(v27==1)
	replace temp_contract =. if v27==.
	
gen computer =(v160==1)
	replace computer =. if v160==.
	
gen d_routine=0
	replace d_routine=1 if inlist(v185,1,2)
	replace d_routine=. if (inlist(v185,1,2,3,4,5)==0)
	

gen shift=( v175==1)
	replace shift=0 if (inlist(v175,0,1)==0)
	

gen occ = v18

gen position = v26 

gen hours =(v15/10)

gen income= v34

gen ind = v20 

gen BIK = v314

gen  firmsize= v21
		replace firmsize=. if (inlist(v21,1,2,3,4,5,6,7,8,9,10)==0)

gen firmsize1=0
	replace firmsize1=1 if inlist(firmsize,1)
	replace firmsize1=. if firmsize==.

gen firmsize2=0
	replace firmsize2=1 if inlist(firmsize,2,3) 
	replace firmsize2=. if firmsize==.
	
gen firmsize3=0
	replace firmsize3=1 if inlist(firmsize,4) 
	replace firmsize3=. if firmsize==.

gen firmsize4=0
	replace firmsize4=1 if inlist(firmsize,5) 
	replace firmsize4=. if firmsize==.

gen firmsize5=0
	replace firmsize4=1 if inlist(firmsize,6,7) 
	replace firmsize4=. if firmsize==.


gen d_codifiable=0
	replace d_codifiable=1 if inlist(v184,1,2)
	replace d_codifiable=. if (inlist(v184,1,2,3,4,5)==.)
gen phys1 = (v176==1)
	replace phys1=. if (inlist(v176,0,1)==0)
gen phys2=(v177==1)
	replace phys2=. if (inlist(v177,0,1)==0)
gen phys3=(v178==1)
	replace phys3=. if (inlist(v178,0,1)==0)
gen phys4=(v180==1)
	replace phys4=. if (inlist(v180,0,1)==0)
gen phys7=(v179==1)
	replace phys7=. if (inlist(v179,0,1)==0)
	
gen east=0


keep year d_deadlines high_edu med_edu low_edu ///
 age  female german    temp_contract shift ///
  computer d_routine occ position hours income ind  BIK ///
  firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys4  phys7 east   
 
drop if income<3 
drop if income>17 
 
save "$data\bibb_1992_short.dta", replace






********************************************************************************
****************************** BIBB 1986 ***************************************
********************************************************************************

use "$orig\ZA1790_v1-0-1.dta", replace
gen year=1986



gen d_deadlines=0
	replace d_deadlines=1 if inlist(v60,1,2)
	replace d_deadlines=. if (inlist(v60,1,2,3,4,5)==0)
	
gen d_multitasking=0
	replace d_multitasking=1 if inlist(v71,1,2)
	replace d_multitasking=. if (inlist(v71,1,2,3,4,5)==0) 
	
gen d_interrupt=0
	replace d_interrupt=1 if inlist(v66,1,2)
	replace d_interrupt=. if (inlist(v66,1,2,3,4,5)==0) 
	
gen d_minimum=0
	replace d_minimum=1 if inlist(v67,1,2)
	replace d_minimum=. if (inlist(v67,1,2,3,4,5)==0) 
	

	
gen high_edu=(v150==1|v151==1)

gen med_edu=0
	replace med_edu=1 if inlist(v133,1,2) & high_edu==0
	replace med_edu=1 if v146==1 & high_edu==0
	replace med_edu=1 if v148==1 & high_edu==0
	replace med_edu=1 if v149==1 & high_edu==0
	
gen low_edu= (med_edu==0 & high_edu==0)

gen age= 86-v176

gen female= (v175==2)

gen weight = v190

gen temp_contract=(v10==1)

gen computer= (v108==1) 

gen d_routine=0
	replace d_routine=1 if inlist(v62,1,2) 
	replace d_routine=. if (inlist(v62,1,2,3,4,5)==0)
	
gen shift=0	
	replace shift=1 if inlist(v58,1,2)
	replace shift=. if (inlist(v58,1,2,3,4,5)==0)
	
ren v5 kldb88_3

joinby kldb88_3 using "$orig\kldb88_3_10_5.dta", unmatched(master)

gen occ = kldb10_3 

gen position = v6 

gen hours =v4

gen income = v126 
	replace income=. if v126==.a
	
gen ind= v8 

gen BIK= v189 

gen  firmsize = v9
	replace firmsize=. if (inlist(v9,1,2,3,4,5,6,7)==0)

gen firmsize1=0
	replace firmsize1=1 if inlist(firmsize,1) 
	replace firmsize1=. if firmsize==.

gen firmsize2=0
	replace firmsize2=1 if inlist(firmsize,2,3) 
	replace firmsize2=. if firmsize==.
	
gen firmsize3=0
	replace firmsize3=1 if inlist(firmsize,4) 
	replace firmsize3=. if firmsize==.

gen firmsize4=0
	replace firmsize4=1 if inlist(firmsize,5) 
	replace firmsize4=. if firmsize==.

gen firmsize5=0
	replace firmsize5=1 if inlist(firmsize,6,7) 
	replace firmsize5=. if firmsize==.
	
gen d_codifiable=0
	replace d_codifiable=1 if inlist(v61,1,2)
	replace d_codifiable=. if (inlist(v61,1,2,3,4,5)==0)

gen phys1=0
	replace phys1=1 if inlist(v48,1,2,3) 
	replace phys1=. if (inlist(v48,1,2,3,4,5)==0 )

gen phys2=0
	replace phys2=1 if inlist(v50,1,2,3) 
	replace phys2=. if (inlist(v50,1,2,3,4,5)==0 )

gen phys3=0
	replace phys3=1 if inlist(v51,1,2,3) 
	replace phys3=. if (inlist(v51,1,2,3,4,5)==0 )

gen phys4=0
	replace phys4=1 if inlist(v53,1,2,3) 
	replace phys4=. if (inlist(v53,1,2,3,4,5)==0 )
	
gen phys6=0
	replace phys6=1 if inlist(v54,1,2,3)==1 
	replace phys6=. if (inlist(v54,1,2,3,4,5)==0 )
	
gen phys7=0
	replace phys7=1 if inlist(v52,1,2,3)==1 
	replace phys7=. if (inlist(v52,1,2,3,4,5)==0 )

	gen east=0

keep year d_deadlines d_multitasking d_interrupt d_minimum high_edu med_edu low_edu ///
 age  female   shift temp_contract ///
  computer d_routine occ position hours income ind BIK ///
  firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys4  phys6 phys7  weight east


keep if age>=20 & age<=60 
keep if position<30 
keep if hours>=35


save "$data\bibb_1986_short.dta", replace





********************************************************************************
****************************** BIBB 1979 ***************************************
********************************************************************************

use "$orig\ZA1243.dta", replace
gen year=1979


gen d_deadlines=0
	replace d_deadlines=1 if inlist(V275,1,2)
	replace d_deadlines=. if (inlist(V275,1,2,3,4,5)==0)
	
gen d_multitasking=0
	replace d_multitasking=1 if inlist(V264,1,2)
	replace d_multitasking=. if (inlist(V264,1,2,3,4,5)==0)

gen d_minimum=0
	replace d_minimum=1 if inlist(V278,1,2)
	replace d_minimum=. if (inlist(V278,1,2,3,4,5)==0)

	
gen high_edu=0
	replace high_edu=1 if V30>0 & V30!=. 
	replace high_edu=1 if V31>0 & V31!=. 
	
gen med_edu=0
	replace med_edu=1 if V8>1 & V8!=. 
	replace med_edu=1 if V25>0 & V25!=. 
	replace med_edu=1 if V23>0 & V23!=. 
	replace med_edu=1 if V22>0 & V22!=. 
	replace med_edu=1 if V26>0 & V26!=. 
	
gen low_edu=(high_edu==0 & med_edu==0)

gen age=79-V437

gen female=(V438==2)

gen weight = V441

gen computer=(V110==1) 

gen d_routine=0
	replace d_routine=1 if inlist(V277,1,2)
	replace d_routine=. if (inlist(V277,1,2,3,4,5)==0)
	
gen shift=0
	replace shift=1 if inlist(V256,1,2) 
	replace shift=. if inlist(V256,1,2,3,4,5)==0
	
gen occ=V67 
replace occ = floor(occ/1000)

gen position = V68 

gen hours = V71

gen income= V435 

gen ind= V47 

gen  firmsize = V11
	replace firmsize=. if (inlist(V11,1,2,3,4,5,6,7)==0)
gen firmsize1=(firmsize==1)	
gen firmsize2=(firmsize==2|firmsize==3)
gen firmsize3=(firmsize==4)	
gen firmsize4=(firmsize==5)	
gen firmsize5=(firmsize==6|firmsize==7)
gen d_codifiable=0
	replace d_codifiable=1 if inlist(V276,1,2)
	replace d_codifiable=. if inlist(V276,1,2,3,4,5)==0
	
gen phys1=0
	replace phys1=1 if inlist(V92,1,2,3) 
	replace phys1=. if (inlist(V92,1,2,3,4,5)==0 )

gen phys2=0
	replace phys2=1 if inlist(V253,1,2,3) 
	replace phys2=. if (inlist(V253,1,2,3,4,5)==0 )

gen phys3=0
	replace phys3=1 if inlist(V254,1,2,3) 
	replace phys3=. if (inlist(V254,1,2,3,4,5)==0 )

gen phys5=0
	replace phys5=1 if inlist(V86,1,2,3) 
	replace phys5=1 if inlist(V87,1,2,3) 
	replace phys5=1 if inlist(V89,1,2,3) 
	
	replace phys5=. if (inlist(V86,1,2,3,4,5)==0 & inlist(V87,1,2,3,4,5)==0 & inlist(V89,1,2,3,4,5)==0 )

	
gen phys7=0
	replace phys7=1 if inlist(V255,1,2,3)==1 
	replace phys7=. if (inlist(V255,1,2,3,4,5)==0 )
	
gen east=0

 
keep year d_deadlines d_minimum d_multitasking high_edu med_edu low_edu ///
 age  female  shift computer ///
   d_routine  position hours income ind ///
  firmsize1 firmsize2 firmsize3 firmsize4 firmsize5 d_codifiable ///
 phys1 phys2 phys3 phys5  phys7 weight occ east
 

 
keep if age>=20 & age<=60 
keep if position<20 
keep if hours>=35


save "$data\bibb_1979_short.dta", replace





use "$data\bibb_1979_short.dta", replace
append using "$data\bibb_1986_short.dta"
append using "$data\bibb_1999_short.dta"
append using "$data\bibb_2006_short.dta"
append using "$data\bibb_2012_short.dta"
append using "$data\bibb_2018_short.dta"
compress

















*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure A.6                                           /
*                        Time Trend in Work Pressure                          /
*                                                                             /
*////////////////////////////////////////////////////////////////////////////7/

preserve
keep if east==0
collapse d_deadlines d_multitasking  d_interrupt d_minimum  [aw=weight], by(year)
sort year
label var d_deadlines  "Deadlines"
label var  d_multitasking  "Multitasking"
label var  d_interrupt "Interruptions"
label var d_minimum "Minimum Requirements"

replace d_deadlines=100*d_deadlines 
replace d_multitasking=100*d_multitasking 
replace d_interrupt=100*d_interrupt 
replace d_minimum=100*d_minimum


graph twoway ///
(line d_deadlines  year, lc(cranberry) lp(solid) lw(thick)) ///
(line d_multitasking  year, lc(edkblue) lp(dash) lw(thick)) ///
(line d_minimum year, lc(forest_green) lp(dash_dot) lw(thick)) ///
(line d_interrupt year, lc(dkorange) lp(shortdash) lw(thick)) ///
, ytitle("Share (%)") xtitle("Year") xsize(6) legend(position(6)  cols(2)) ///
yscale(range(10 65)) ylabel(10(10)60) ///
yline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(20, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(30, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(40, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(50, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(60, lpattern(dash) lcolor(gs13) lwidth(vthin)) 
restore












*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure A.7, panel (a)                                /
*                        Composition adjustment age, education, gender        /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

gen age2=age^2
gen age3=age^3

preserve
keep if east==0

reg d_deadlines high_edu med_edu age age2 age3 female [aw=weight]
predict d_deadlines_res, res

reg d_multitasking high_edu med_edu age age2 age3 female [aw=weight]
predict d_multitasking_res, res

reg d_minimum high_edu med_edu age age2 age3 female [aw=weight]
predict d_minimum_res, res

reg d_interrupt high_edu med_edu age age2 age3 female [aw=weight]
predict d_interrupt_res, res

collapse d_deadlines_res d_multitasking_res d_minimum_res d_interrupt_res [aw=weight], by(year)
sort year

label var d_deadlines_res  "Deadlines"
label var  d_multitasking_res  "Multitasking"
label var  d_interrupt_res "Interruptions"
label var d_minimum_res "Minimum Requirements"

replace d_deadlines_res=100*d_deadlines_res 
replace d_multitasking_res=100*d_multitasking_res 
replace d_interrupt_res=100*d_interrupt_res 
replace d_minimum_res=100*d_minimum_res

graph twoway ///
(line d_deadlines  year, lc(cranberry) lp(solid) lw(thick)) ///
(line d_multitasking  year, lc(edkblue) lp(dash) lw(thick)) ///
(line d_minimum year, lc(forest_green) lp(dash_dot) lw(thick)) ///
(line d_interrupt year, lc(dkorange) lp(shortdash) lw(thick)) ///
, ytitle("Composition-adjusted share (%)") xtitle("Year") xsize(6) legend(position(6)  cols(2)) ///
yscale(range(-12 12)) ylabel(-10(5)10) ///
yline(-10, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(-5, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(0, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) 
restore





*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure A.7, panel (b)                                /
*                        Composition adjustment age, education, gender,       /
*                                               occupations                   /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

tab occ, gen(d_occ_)

preserve
keep if east==0

reg d_deadlines d_occ_* high_edu med_edu age age2 age3 female  [aw=weight]
predict d_deadlines_res, res

reg d_multitasking d_occ_* high_edu med_edu age age2 age3 female [aw=weight]
predict d_multitasking_res, res

reg d_minimum d_occ_* high_edu med_edu age age2 age3 female [aw=weight]
predict d_minimum_res, res

reg d_interrupt d_occ_* high_edu med_edu age age2 age3 female [aw=weight]
predict d_interrupt_res, res

collapse d_deadlines_res d_multitasking_res d_minimum_res d_interrupt_res [aw=weight], by(year)
sort year

label var d_deadlines_res  "Deadlines"
label var  d_multitasking_res  "Multitasking"
label var  d_interrupt_res "Interruptions"
label var d_minimum_res "Minimum Requirements"

replace d_deadlines_res=100*d_deadlines_res 
replace d_multitasking_res=100*d_multitasking_res 
replace d_interrupt_res=100*d_interrupt_res 
replace d_minimum_res=100*d_minimum_res

graph twoway ///
(line d_deadlines  year, lc(cranberry) lp(solid) lw(thick)) ///
(line d_multitasking  year, lc(edkblue) lp(dash) lw(thick)) ///
(line d_minimum year, lc(forest_green) lp(dash_dot) lw(thick)) ///
(line d_interrupt year, lc(dkorange) lp(shortdash) lw(thick)) ///
, ytitle("Composition-adjusted share (%)") xtitle("Year") xsize(6) legend(position(6)  cols(2)) ///
yscale(range(-12 12)) ylabel(-10(5)10) ///
yline(-10, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(-5, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(0, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(5, lpattern(dash) lcolor(gs13) lwidth(vthin)) ///
yline(10, lpattern(dash) lcolor(gs13) lwidth(vthin)) 

restore








*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Table A.1                                            /
*                        Descriptives of BIBB over time                       /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////

gen pressure= (d_deadlines + d_multitasking + d_interrupt + d_minimum )/4


save "$data\trends_data.dta", replace


****************************** Descriptives 
{
global characteristics1 d_deadlines d_multitasking d_interrupt d_minimum pressure high_edu med_edu low_edu age  female temp_contract shift computer d_routine d_codifiable 
eststo clear
label var pressure "High pressure index"
label var d_deadlines "Deadlines"
label var d_multitasking  "Multitasking"
label var d_interrupt  "Interruptions"
label var d_minimum  "Minimum requirements"
label var high_edu "High education"
label var med_edu "Medium education"
label var low_edu   "Low education"
label var age  "Age"
label var female "Female"
label var temp_contract "Temporary contract"
label var shift "Shift work"
label var computer "Computer use"
label var d_routine "Routine job"
label var d_codifiable "Codifiable job"

keep if east==0
sort year
by year: eststo:  estpost summarize $characteristics1 [aw=weight] //, listwise
}




*//////////////////////////////////////////////////////////////////////////////
*                                                                             /
*                        Figure A.9                                           /
*                        Hedonic regressions by BIBB wave                     /
*                                                                             /
*//////////////////////////////////////////////////////////////////////////////


************2012*******************

use "$data\trends_data.dta", replace
numlabel _all, add
keep if year == 2012

keep if age>=20 & age<=60 
keep if inlist(position,1,2,9) 
keep if hours>=35
drop if income==99999 | income==99998
drop if income<1000
drop if income>=50000
drop if inlist(occ,-1,-30,-111) 

drop if inlist(ind,-4) 

drop if missing(income, hours, high_edu, med_edu, low_edu, age, female, /*
*/      nuts2, BIK, temp_agency, firmsize1, /*
*/      firmsize2, firmsize3, firmsize4, firmsize5, d_routine, d_codifiable, /*
*/      computer, temp_contract, phys1, phys2, phys3, phys4, phys5, phys6, phys7, /*
*/      d_deadlines, d_interrupt, d_fast, d_minimum, /*
*/      d_multitasking, german, ind, occ)

gen ln_income=ln(income)
gen wage=income/(hours*4)
gen ln_wage=ln(wage)
gen ln_hours=ln(hours)

tab occ, gen(d_occ2d_)
tab ind, gen(d_ind_)
tab BIK, gen(d_bik_)

gen phys_index = (phys1+phys2+phys3+phys4+phys5+phys6+phys7)/7	
			
gen pressure_dummy=0
	replace pressure_dummy=1 if d_deadlines==1 & d_multitasking==1 /*
	*/                       & d_interrupt==1 & d_minimum==1 

label variable pressure "High pressure"
label variable pressure_dummy "high pressure (dummy)"
label variable age "Age"
label variable age2 "age^2"
label variable age3 "age^3"
label variable high_edu "University"
label variable med_edu "Vocational"
label variable low_edu "No degree"
label variable works_council "Works council"
label variable temp_agency "Temp. work agency"
label variable firmsize1 "<5 employees"
label variable firmsize2 "5-49 employees"
label variable firmsize3 "50-249 employees"
label variable firmsize4 "250-999 employees"
label variable firmsize5 ">=1,000 employees"
label variable d_routine "Routine job"
label variable d_codifiable "codifiable job"
label variable computer "Computer use"
label variable commute "Commuting"
label variable temp_contract "Temp. contract"
label variable phys_index "physical"
label var normal_workhours "Standard work hours"
label var shift "Shift work"
label var standby "Frequent stand-by for work"
label var female "Female"
label var german "German"



global ext_mincer "high_edu med_edu age age2 age3 female german i.nuts2 d_bik_*"
global occ_ind "d_occ2d_* d_ind_*"
global firm_empl "temp_agency temp_contract firmsize2 firmsize3 firmsize4 firmsize5 normal_workhours shift standby" 
global tasks "d_routine d_codifiable computer phys_index"


reg ln_income pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store inc_2012

reg ln_wage pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store wage_2012

reg ln_hours pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store hours_2012






************2006*******************

use "$data\trends_data.dta", replace
numlabel _all, add

keep if year == 2006


keep if age>=20 & age<=60 
keep if inlist(position,1,2,9) 
keep if hours>=35
drop if income==99999 | income==99998
drop if income<1000
drop if income>=50000
drop if inlist(occ,-1,-10,-16,-18,-19,-30) 


drop if missing(income, hours, high_edu, med_edu, low_edu, age, female, /*
*/      nuts2, BIK, temp_agency, firmsize1, /*
*/      firmsize2, firmsize3, firmsize4, firmsize5, d_routine, d_codifiable, /*
*/      computer, temp_contract, phys1, phys2, phys3, phys4, phys6, phys7, /*
*/      d_deadlines, d_interrupt, d_fast, d_minimum, /*
*/      d_multitasking, german, ind, shift, standby, occ)


gen ln_income=ln(income)
gen wage=income/(hours*4)
gen ln_wage=ln(wage)
gen ln_hours=ln(hours)




tab occ, gen(d_occ2d_)
tab ind, gen(d_ind_)
tab BIK, gen(d_bik_)

gen phys_index = (phys1+phys2+phys3+phys4+phys6+phys7)/6	
		

	
gen pressure_dummy=0
	replace pressure_dummy=1 if d_deadlines==1 & d_multitasking==1 /*
	*/                       & d_interrupt==1 & d_minimum==1 

label variable pressure "High pressure"
label variable pressure_dummy "high pressure (dummy)"
label variable age "Age"
label variable age2 "age^2"
label variable age3 "age^3"
label variable high_edu "University"
label variable med_edu "Vocational"
label variable low_edu "No degree"
label variable works_council "Works council"
label variable temp_agency "Temp. work agency"
label variable firmsize1 "<5 employees"
label variable firmsize2 "5-49 employees"
label variable firmsize3 "50-249 employees"
label variable firmsize4 "250-999 employees"
label variable firmsize5 ">=1,000 employees"
label variable d_routine "Routine job"
label variable d_codifiable "codifiable job"
label variable computer "Computer use"
label variable commute "Commuting"
label variable temp_contract "Temp. contract"
label variable phys_index "physical"
label var normal_workhours "Standard work hours"
label var shift "Shift work"
label var standby "Frequent stand-by for work"
label var female "Female"
label var german "German"


global ext_mincer "high_edu med_edu age age2 age3 female german i.nuts2 d_bik_*"
global occ_ind "d_occ2d_* d_ind_*"
global firm_empl "temp_agency temp_contract firmsize2 firmsize3 firmsize4 firmsize5 shift standby" 
global tasks "d_routine d_codifiable computer phys_index"


reg ln_income pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store inc_2006

reg ln_wage pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store wage_2006

reg ln_hours pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store hours_2006







************1999*******************

use "$data\trends_data.dta", replace
numlabel _all, add

keep if year == 1999

keep if age>=20 & age<=60 
tab position
keep if inlist(position, 1,2,9) 
keep if hours>=35

tab income
recode income  ///
(1=300) (2=800) (3=1250) (4=1750) (5=2250) ///
(6=2750) (7=3250) (8=3750) (9=4250) (10=4750) ///
(11=5250) (12=5750) (13=6500) (14=7500) (15=8500) ///
(16=9500) (17=12500) (18=15000)				 


drop if missing(income, hours, high_edu, med_edu, low_edu, age, female, /*
*/      BIK, temp_agency, firmsize1, /*
*/      firmsize2, firmsize3, firmsize4, firmsize5, d_routine, d_codifiable, /*
*/      computer, temp_contract, phys1, phys2, phys3, phys4, phys6, phys7, /*
*/      d_deadlines, d_interrupt, d_minimum, /*
*/      d_multitasking, german, ind, shift, weight, position, occ)



gen ln_income=ln(income)
gen wage=income/(hours*4)
gen ln_wage=ln(wage)
gen ln_hours=ln(hours)




tab occ, gen(d_occ2d_)
tab ind, gen(d_ind_)
tab BIK, gen(d_bik_)

gen phys_index = (phys1+phys2+phys3+phys4+phys6+phys7)/6
		

	
gen pressure_dummy=0
	replace pressure_dummy=1 if d_deadlines==1 & d_multitasking==1 /*
	*/                       & d_interrupt==1 & d_minimum==1 

label variable pressure "High pressure"
label variable pressure_dummy "high pressure (dummy)"
label variable age "Age"
label variable age2 "age^2"
label variable age3 "age^3"
label variable high_edu "University"
label variable med_edu "Vocational"
label variable low_edu "No degree"
label variable works_council "Works council"
label variable temp_agency "Temp. work agency"
label variable firmsize1 "<5 employees"
label variable firmsize2 "5-49 employees"
label variable firmsize3 "50-249 employees"
label variable firmsize4 "250-999 employees"
label variable firmsize5 ">=1,000 employees"
label variable d_routine "Routine job"
label variable d_codifiable "codifiable job"
label variable computer "Computer use"
label variable commute "Commuting"
label variable temp_contract "Temp. contract"
label variable phys_index "physical"
label var normal_workhours "Standard work hours"
label var shift "Shift work"
label var standby "Frequent stand-by for work"
label var female "Female"
label var german "German"


global ext_mincer "high_edu med_edu age age2 age3 female german d_bik_*"  
global occ_ind "d_occ2d_* d_ind_*"
global firm_empl "temp_agency temp_contract firmsize2 firmsize3 firmsize4 firmsize5 shift"
global tasks "d_routine d_codifiable computer phys_index"



reg ln_income pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store inc_1999

reg ln_wage pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store wage_1999

reg ln_hours pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store hours_1999














************1986*******************

use "$data\trends_data.dta", replace
numlabel _all, add

keep if year == 1986


keep if age>=20 & age<=60 
keep if hours>=35
keep if inrange(position,10,25) 
tab income
recode income  ///
(1=400) (2=500) (3=700) (4=900) (5=1125) ///
(6=1375) (7=1625) (8=1875) (9=2125) (10=2375) ///
(11=2625) (12=2875) (13=3250) (14=3750) (15=4250) ///
(16=4750) (17=5250) (18=5750) (19=7000) (20=9000) (21=12500) (22=15000)				 


drop if missing(income, hours, high_edu, med_edu, low_edu, age, female, /*
*/      BIK, firmsize1, /*
*/      firmsize2, firmsize3, firmsize4, firmsize5, d_routine, d_codifiable, /*
*/      computer, temp_contract, phys1, phys2, phys3, phys4, phys6, phys7, /*
*/      d_deadlines, d_interrupt, d_minimum, /*
*/      d_multitasking, ind, shift, weight, position, occ)


gen ln_income=ln(income)
gen wage=income/(hours*4)
gen ln_wage=ln(wage)
gen ln_hours=ln(hours)




tab occ, gen(d_occ2d_)
tab ind, gen(d_ind_)
tab BIK, gen(d_bik_)

gen phys_index = (phys1+phys2+phys3+phys4+phys6+phys7)/6
		
	
gen pressure_dummy=0
	replace pressure_dummy=1 if d_deadlines==1 & d_multitasking==1 /*
	*/                       & d_interrupt==1 & d_minimum==1 

label variable pressure "High pressure"
label variable pressure_dummy "high pressure (dummy)"
label variable age "Age"
label variable age2 "age^2"
label variable age3 "age^3"
label variable high_edu "University"
label variable med_edu "Vocational"
label variable low_edu "No degree"
label variable works_council "Works council"
label variable temp_agency "Temp. work agency"
label variable firmsize1 "<5 employees"
label variable firmsize2 "5-49 employees"
label variable firmsize3 "50-249 employees"
label variable firmsize4 "250-999 employees"
label variable firmsize5 ">=1,000 employees"
label variable d_routine "Routine job"
label variable d_codifiable "codifiable job"
label variable computer "Computer use"
label variable commute "Commuting"
label variable temp_contract "Temp. contract"
label variable phys_index "physical"
label var normal_workhours "Standard work hours"
label var shift "Shift work"
label var standby "Frequent stand-by for work"
label var female "Female"
label var german "German"


global ext_mincer "high_edu med_edu age age2 age3 female d_bik_*"  
global occ_ind "d_occ2d_* d_ind_*"
global firm_empl "temp_contract firmsize2 firmsize3 firmsize4 firmsize5 shift"
global tasks "d_routine d_codifiable computer phys_index"


reg ln_income pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store inc_1986

reg ln_wage pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store wage_1986

reg ln_hours pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store hours_1986





************1979*******************

use "$data\trends_data.dta", replace
numlabel _all, add

keep if year == 1979


keep if age>=20 & age<=60 
keep if hours>=35
tab income
recode income  ///
(1=400) (2=500) (3=700) (4=900) (5=1125) ///
(6=1375) (7=1625) (8=1875) (9=2250) (10=2750) ///
(11=3500) (12=4500) (13=5000) 		
tab occ	 

drop if missing(income, hours, high_edu, med_edu, low_edu, age, female, /*
*/      firmsize1, /*
*/      firmsize2, firmsize3, firmsize4, firmsize5, d_routine, d_codifiable, /*
*/      computer, phys1, phys2, phys3, phys5, phys7, /*
*/      d_deadlines, d_minimum, /*
*/      d_multitasking, ind, shift, weight, position)

gen ln_income=ln(income)
gen wage=income/(hours*4)
gen ln_wage=ln(wage)
gen ln_hours=ln(hours)





tab ind, gen(d_ind_)

gen phys_index = (phys1+phys2+phys3+phys5+phys7)/5	

drop pressure	
gen pressure= (d_deadlines + d_multitasking + d_minimum)/3
	
gen pressure_dummy=0
	replace pressure_dummy=1 if d_deadlines==1 & d_multitasking==1 /*
	*/                      & d_minimum==1 

label variable pressure "High pressure"
label variable pressure_dummy "high pressure (dummy)"
label variable age "Age"
label variable age2 "age^2"
label variable age3 "age^3"
label variable high_edu "University"
label variable med_edu "Vocational"
label variable low_edu "No degree"
label variable works_council "Works council"
label variable temp_agency "Temp. work agency"
label variable firmsize1 "<5 employees"
label variable firmsize2 "5-49 employees"
label variable firmsize3 "50-249 employees"
label variable firmsize4 "250-999 employees"
label variable firmsize5 ">=1,000 employees"
label variable d_routine "Routine job"
label variable d_codifiable "codifiable job"
label variable computer "Computer use"
label variable commute "Commuting"
label variable temp_contract "Temp. contract"
label variable phys_index "physical"
label var normal_workhours "Standard work hours"
label var shift "Shift work"
label var standby "Frequent stand-by for work"
label var female "Female"
label var german "German"

global ext_mincer "high_edu med_edu age age2 age3 female"  
global occ_ind "d_ind_*"
global firm_empl "firmsize2 firmsize3 firmsize4 firmsize5 shift" 
global tasks "d_routine d_codifiable computer phys_index"


reg ln_income pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store inc_1979

reg ln_wage pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store wage_1979

reg ln_hours pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store hours_1979





********* 2018

use "$data\bibb_2018_processed.dta", replace

global ext_mincer "high_edu med_edu age age2 age3 female german i.nuts2 d_bik_* grade_*"
global occ_ind "d_occ2d_* d_ind_*"
global firm_empl "works_council temp_agency commute temp_contract firmsize2 firmsize3 firmsize4 firmsize5 normal_workhours shift standby number_sub"
global tasks "d_routine d_codifiable computer phys_index"

replace ln_income=ln_income/100
replace ln_wage=ln_wage/100
replace ln_hours=ln_hours/100

reg ln_income pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store inc_2018

reg ln_wage pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store wage_2018

reg ln_hours pressure $ext_mincer $occ_ind [pw=weight], vce(cluster occ)
estimates store hours_2018






coefplot inc_1979 inc_1986 inc_1999 inc_2006 inc_2012 inc_2018, keep(pressure) title(Earnings regression with extended mincer and occ_ind) ///
vertical ///
yline(0.1246, lpattern(dash) lwidth(vthin)) yline(0, lwidth(vthin) lc(gs7))  yscale(range(-0.02 0.26)) ylabel(-0.02(0.04)0.26) ///
p1(pstyle(p1) label("1979")) ///
p2(pstyle(p2) label("1986")) ///
p3(pstyle(p3) label("1999")) ///
p4(pstyle(p4) label("2006")) ///
p5(pstyle(p5) label("2012")) ///
p6(pstyle(p6) label("2018")) /// 
mlabel format(%9.2g) mlabgap(*2) ciopts(recast(rcap)) legend(rows(1))





coefplot wage_1979 wage_1986 wage_1999 wage_2006 wage_2012 wage_2018 , ///
keep(pressure) title(Wage regression with extended mincer and occ_ind) ///
vertical ///
yline(0.06, lpattern(dash) lwidth(vthin)) yline(0, lwidth(vthin) lc(gs7))  yscale(range(-0.02 0.26)) ylabel(-0.02(0.04)0.26) ///
p1(pstyle(p1) label("1979")) ///
p2(pstyle(p2) label("1986")) ///
p3(pstyle(p3) label("1999")) ///
p4(pstyle(p4) label("2006")) ///
p5(pstyle(p5) label("2012")) ///
p6(pstyle(p6) label("2018")) /// 
mlabel format(%9.2g) mlabgap(*2) ciopts(recast(rcap)) legend(rows(1))





coefplot hours_1979 hours_1986 hours_1999 hours_2006 hours_2012 hours_2018 , keep(pressure)  title(Hours regression with extended mincer and occ_ind) ///
vertical ///
yline(0.065, lpattern(dash) lwidth(vthin)) yline(0, lwidth(vthin) lc(gs7)) yscale(range(-0.02 0.14)) ylabel(-0.02(0.02)0.14)  ///
p1(pstyle(p1) label("1979")) ///
p2(pstyle(p2) label("1986")) ///
p3(pstyle(p3) label("1999")) ///
p4(pstyle(p4) label("2006")) ///
p5(pstyle(p5) label("2012")) ///
p6(pstyle(p6) label("2018")) /// 
mlabel format(%9.2g) mlabgap(*2) ciopts(recast(rcap)) legend(rows(1))































